package com.sanhuo.triild.Basic;

import com.sanhuo.triild.page.Page;
import com.sanhuo.triild.page.PageSearch;

import java.util.List;

public abstract class BaseService<T> {

    public abstract BaseMapper<T> getBaseMapper();


    public void save(T entity) {
        getBaseMapper().save(entity);
    }

    public void update(T entity) {
        getBaseMapper().update(entity);
    }

    public T findById(String id) {
        return getBaseMapper().findById(id);
    }

    public List<T> findAll() {
        return getBaseMapper().findAll();
    }

    public Page<T> listAll(PageSearch pageSearch) {
        return getBaseMapper().listAll(pageSearch);
    }

    public void remove(String id) {
        getBaseMapper().remove(id);
    }

}
